//
//  WYBaseViewController.swift
//  Weibo
//
//  Created by Mr.Run on 2016/11/19.
//  Copyright © 2016年 Mr.Run. All rights reserved.
//

import UIKit

class WYBaseViewController: UIViewController {
    
    lazy var navigationBar = UINavigationBar(frame: CGRect(x: 0, y: 0, width: UIScreen.cz_screenWidth(), height: 64))
    lazy var navItem = UINavigationItem()
    
    override func viewDidLoad() {
        super.viewDidLoad()

        setupUI()
        
    }
    
    override var title: String?{
        didSet{
            
            navItem.title = title
            
        }
    }
    
}

extension WYBaseViewController{
    
    func setupUI() {
        view.backgroundColor = UIColor.cz_random()
        view.addSubview(navigationBar)
        navigationBar.items = [navItem]
        navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: UIColor.darkGray]
    }
    
}
